Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@manypkg/find-root
Advanced tools
> Find the root of a monorepo with Yarn workspaces, Bolt, Lerna, pnpm or Rush
@manypkg/find-root is an npm package designed to help you find the root directory of a monorepo or a project. This can be particularly useful in monorepo setups where you need to determine the root directory from a nested package.
Find the root directory of a monorepo
This feature allows you to find the root directory of a monorepo starting from the current working directory. The `findRoot` function will traverse up the directory tree until it finds the root directory.
const findRoot = require('@manypkg/find-root');
const rootDir = findRoot(process.cwd());
console.log(rootDir);
Find the root directory with a custom start path
This feature allows you to specify a custom start path from which to begin the search for the root directory. This can be useful if you want to find the root directory from a specific location in your project.
const findRoot = require('@manypkg/find-root');
const rootDir = findRoot('/path/to/start');
console.log(rootDir);
The `find-root` package is a similar utility that helps you find the root directory of a project by looking for a specific file (like `package.json`). It is simpler and more focused on finding the root directory based on the presence of a file, whereas @manypkg/find-root is more tailored for monorepo setups.
The `pkg-dir` package finds the root directory of a Node.js project by looking for the nearest `package.json` file. It is similar to @manypkg/find-root but is more general-purpose and not specifically designed for monorepos.
Find the root of a monorepo with Yarn workspaces, Bolt, Lerna, pnpm or Rush
yarn add @manypkg/find-root
import { findRoot, findRootSync } from "@manypkg/find-root";
let dir = await findRoot(process.cwd());
let dir = findRootSync(process.cwd());
FAQs
> Find the root of a monorepo with Yarn workspaces, Bolt, Lerna, pnpm or Rush
The npm package @manypkg/find-root receives a total of 1,253,547 weekly downloads. As such, @manypkg/find-root popularity was classified as popular.
We found that @manypkg/find-root demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.